home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / include / GL / gmesa.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-19  |  3.0 KB  |  122 lines

  1. /* $Id: gmesa.h,v 1.3 1997/02/19 10:13:54 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.2
  6.  * Copyright (C) 1995-1997  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: gmesa.h,v $
  26.  * Revision 1.3  1997/02/19 10:13:54  brianp
  27.  * now test for __QUICKDRAW__ like for __BEOS__ (Randy Frank)
  28.  *
  29.  * Revision 1.2  1997/02/03 20:06:22  brianp
  30.  * patches for BeOS
  31.  *
  32.  * Revision 1.1  1996/09/13 01:26:41  brianp
  33.  * Initial revision
  34.  *
  35.  */
  36.  
  37.  
  38. /*
  39.  * (G)eneric Mesa interface
  40.  *
  41.  * This generic interface to Mesa provides minimal functionality.  It's
  42.  * intended to be an _experimental_ interface for projects such as Linux/3-D
  43.  * hardware.  There may eventually be many different implementations of this
  44.  * interface for different operating systems and graphics cards.
  45.  *
  46.  * 
  47.  * Usage:
  48.  *    1. #include <GL/gmesa.h>
  49.  *    2. use GMesaCreateContext() to get a new GMesa context
  50.  *    3. use GMesaMakeCurrent() to activate a GMesa context
  51.  *    4. do your OpenGL rendering
  52.  *    5. use GMesaSwapBuffers() in double buffer mode to swap color buffers
  53.  *    6. use GMesaDestroyContext() to destroy a GMesa context
  54.  *    7. use GMesaGetContext() to return the current context
  55.  *
  56.  *
  57.  * Implementation:
  58.  *    1. GMesaCreateContext() should initialize the hardware and return
  59.  *       a GMesa context struct pointer
  60.  *    2. GMesaMakeCurrent() should activate the context
  61.  *    3. GMesaDestroyContext() should free the context's resources and
  62.  *       reset the hardware
  63.  *    4. GMesaSwapBuffers() should swap the front/back color buffers for
  64.  *       the current context
  65.  *    5. It may be the case that an implementation of this interface only
  66.  *       supports one context at a time.  That's fine.
  67.  */
  68.  
  69.  
  70.  
  71. #ifndef GMESA_H
  72. #define GMESA_H
  73.  
  74.  
  75. #ifdef __cplusplus
  76. extern "C" {
  77. #endif
  78.  
  79.  
  80. /*
  81.  * A version identifier:
  82.  */
  83. #define GMESA_VERSION 1
  84.  
  85.  
  86.  
  87. /*
  88.  * This is the GMesa context 'handle':
  89.  */
  90. typedef struct gmesa_context *GMesaContext;
  91.  
  92.  
  93.  
  94. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  95. #pragma export on
  96. #endif
  97.  
  98.  
  99. extern GMesaContext GMesaCreateContext( void );
  100.  
  101. extern void GMesaDestroyContext( GMesaContext ctx );
  102.  
  103. extern void GMesaMakeCurrent( GMesaContext ctx );
  104.  
  105. extern GMesaContext GMesaGetCurrentContext( void );
  106.  
  107. extern GMesaSwapBuffers( void );
  108.  
  109.  
  110. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  111. #pragma export off
  112. #endif
  113.  
  114.  
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118.  
  119.  
  120. #endif
  121.  
  122.